//
//  KismetController.h
//  kismet-frontend
//
//  Created by L. Preston Sego III on 7/18/09.
//  Copyright 2009 Precognition Inc.. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface KismetController : NSObject 
{
    // User will have to have Kismet installed and have the server running.
    
    //Networking stuff
    NSString *server_host;
    NSInteger server_port;
    
    NSInputStream *iStream;
    NSOutputStream *oStream;
    
    NSNumber *bytesRead;
    unsigned int byteIndex;
    NSMutableData * dataBuffer;
    NSString *responseString;
    
    //Direct Connect GUI
    IBOutlet NSWindow *window;
    IBOutlet NSTextField *commandEntry;
    IBOutlet NSTextField *response;

    
}
-(IBAction)go:(id)sender;

- (void)connectAndSetupServer;
- (void)stream: (NSStream *)astream handleEvent:(NSStreamEvent)eventStream;
- (void)processData:(NSString *)stringOfData;
- (void)openStreams;
- (void)closeStreams;

- (NSString *)sendCommandToServer:(NSString *)command;


// basic server commands
- (void)killServer;
- (NSString *)enable:(NSString *)protocol;
- (NSString *)enable:(NSString *)protocol withOptionsSeparatedByCommas:(NSString *)options;
- (NSString *)disable:(NSString *)protocol;

- (NSString *)addSource:(NSString *)uuid;
- (NSString *)addSource:(NSString *)uuid withOptions:(NSString *)options;
- (NSString *)deleteSource:(NSString *)uuid;
- (NSString *)channelHop:(NSString *)uuid;
- (NSString *)channelLock:(NSString *)uuid forChannel:(NSString *)channels;
- (NSString *)channelSequence:(NSString *)uuid forCommaSeparatedListOfChannels:(NSString *)listOfChannels;

- (NSString *)listWepKeys;
- (NSString *)addWepKey:(NSString *)bssid forKeyInHex:(NSString *)key;
- (NSString *)deleteWepKey:(NSString *)bssid;

- (void)killTime;
- (void)startSendingNetworkInfo;
- (void)stopSendingNetworkInfo;


@end
